/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.97
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */
define(['exports', './Matrix2-276d97d2', './OrientedBoundingBox-60b83ce5'], function (n, t, e) { 'use strict'; const r = {}; const a = new t.Cartesian3(); const i = new t.Cartesian3(); const o = new t.Cartesian3(); const u = new t.Cartesian3(); const s = new e.OrientedBoundingBox(); function c (n, e, r, i, o) { const u = t.Cartesian3.subtract(n, e, a); const s = t.Cartesian3.dot(r, u); const c = t.Cartesian3.dot(i, u); return t.Cartesian2.fromElements(s, c, o) }r.validOutline = function (n) { const r = e.OrientedBoundingBox.fromPoints(n, s).halfAxes; const a = t.Matrix3.getColumn(r, 0, i); const c = t.Matrix3.getColumn(r, 1, o); const C = t.Matrix3.getColumn(r, 2, u); const m = t.Cartesian3.magnitude(a); const d = t.Cartesian3.magnitude(c); const g = t.Cartesian3.magnitude(C); return !(m === 0 && (d === 0 || g === 0) || d === 0 && g === 0) }, r.computeProjectTo2DArguments = function (n, r, a, c) { const C = e.OrientedBoundingBox.fromPoints(n, s); const m = C.halfAxes; const d = t.Matrix3.getColumn(m, 0, i); const g = t.Matrix3.getColumn(m, 1, o); const l = t.Matrix3.getColumn(m, 2, u); const f = t.Cartesian3.magnitude(d); const x = t.Cartesian3.magnitude(g); const B = t.Cartesian3.magnitude(l); const M = Math.min(f, x, B); if (f === 0 && (x === 0 || B === 0) || x === 0 && B === 0) return !1; let P, w; return M !== x && M !== B || (P = d), M === f ? P = g : M === B && (w = g), M !== f && M !== x || (w = l), t.Cartesian3.normalize(P, a), t.Cartesian3.normalize(w, c), t.Cartesian3.clone(C.center, r), !0 }, r.createProjectPointsTo2DFunction = function (n, t, e) { return function (r) { const a = new Array(r.length); for (let i = 0; i < r.length; i++)a[i] = c(r[i], n, t, e); return a } }, r.createProjectPointTo2DFunction = function (n, t, e) { return function (r, a) { return c(r, n, t, e, a) } }; const C = r; n.CoplanarPolygonGeometryLibrary = C })
